/**
 * Created by hjqi on 2016/6/1.
 */

//db require part
var imageMetaInfoDB = require('../../db/ImageMetaInfoDB');
var _imageMetaInfoDB = new imageMetaInfoDB();

module.exports = libImageService;

function libImageService(){

}

libImageService.prototype.getImageMetaInfo = function(ns, imageId){
    return new Promise(function (resolve, reject) {
        _imageMetaInfoDB.getWithParam(null,{namespace: ns, imageId:imageId}, function(err,rets){
            if (err) {
                reject(err.message);
            } else {
                if(rets.length === 0)
                    resolve(undefined);
                else
                    resolve(rets[0]);
            }
        });
    });

}